package com.itheima;

import java.util.ArrayList;

public class demo5 {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<Student>();

        Student student1 = new Student("大佬", 19);
        Student student2 = new Student("是多福多寿", 1000);

        students.add(student1);
        students.add(student2);

        for (int i =0;i < students.size(); i++) {
            Student stu = students.get(i);
            System.out.println("名字：" + stu.getName() + "，年龄："+ stu.getAge());
        }
        System.out.println();
    }
}
